package com.xnyzc.lhy.resource.entity.worksheet.param;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @Description 查询订单列表
 * @Author haoyfa
 * @Date 2019/11/05
 **/
@Data
public class WorksheetgetOrderPersonalListParam implements Serializable {
    @ApiModelProperty(value = "用户token")
    private String userToken;

    @ApiModelProperty(value = "工单 id")
    private String worksheetId;

    @ApiModelProperty(value = "乘客电话号码", name="cus_phone")
    private String cusPhone;

    @ApiModelProperty(value = "乘客ID", name="didUserId")
    private String didUserId;

    @ApiModelProperty(value = "反馈人类型", name="cus_type")
    private String cusType;

    @ApiModelProperty(value = "订单下单时间开始")
    private String orderTimeStart;

    @ApiModelProperty(value = "订单下单时间结束")
    private String orderTimeEnd;

    @ApiModelProperty(value = "验签")
    private String sign;

    @ApiModelProperty(value = "页数")
    private Integer page;

    @ApiModelProperty(value = "数据库分页")
    private Integer index;

    @ApiModelProperty(value = "每页条数")
    private Integer pageSize;

    @ApiModelProperty(value = "总条数")
    private Integer pageTotal;

    public WorksheetgetOrderPersonalListParam() {
        this.page = 1;
        this.pageSize = 10;
        this.index = 0;
    }

    public void setPageSize(Integer pageSize) {
        if (pageSize < 1) {
            pageSize = 10;
        }
        this.pageSize = pageSize;
        this.index = (page - 1) * pageSize;
    }

    public void setPage(Integer page) {
        if (page < 1) {
            page = 1;
        }
        this.page = page;
        this.index = (page - 1) * pageSize;
    }
}
